package com.wd.myhome.view.activity

import android.content.Intent
import android.media.MediaPlayer
import android.media.MediaPlayer.OnCompletionListener
import android.net.Uri
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.wd.live.base.BaseActivity
import com.wd.myhome.R
import com.wd.myhome.databinding.ActivityConstellationBinding
import com.wd.myhome.viewmodel.ConstellationViewModel

class Constellation : BaseActivity<ConstellationViewModel,ActivityConstellationBinding> (R.layout.activity_constellation){
    override fun dataObserver() {

    }

    override fun initViews() {
        val url:String="android.resource://"+packageName+"/"+R.raw.constellation
        binding.video.setVideoURI(Uri.parse(url))
        binding.video.start()
        //动画结束监听，当结束时跳转到星座匹配
        binding.video.setOnCompletionListener(object :OnCompletionListener{
            override fun onCompletion(p0: MediaPlayer?) {
                startActivity(Intent(this@Constellation,ConstellationmatchingActivity::class.java))
                finish()
            }
        })



    }

}